package cn.outsourcing.supermarket.mapper;

import cn.outsourcing.supermarket.common.constants.BackstageProviderConstants;
import cn.outsourcing.supermarket.provider.BackstageOrderProvider;
import cn.outsourcing.supermarket.vo.backstage.BackstageOrdersInfoVO;
import cn.outsourcing.supermarket.vo.hiolabs.HiolabsOrderGoodsVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.SelectProvider;

import java.util.List;

/**
 * 后台订单 Mapper
 *
 * @author gzkemays
 * @since 2021/11/3 2:35
 */
@Mapper
public interface BackstageOrderMapper {
  /**
   * 获取后台订单详情信息
   *
   * @param orderId 订单 id
   * @return 详情信息
   */
  @SelectProvider(
      value = BackstageOrderProvider.class,
      method = BackstageProviderConstants.BACKSTAGE_ORDERS_DETAILS)
  BackstageOrdersInfoVO getOrderDetails(@Param(value = "orderId") Integer orderId);

  /**
   * 获取订单商品的详情信息，关联 product 表
   *
   * @param orderId 订单 id
   * @return 详情信息
   */
  @SelectProvider(
      value = BackstageOrderProvider.class,
      method = BackstageProviderConstants.BACKSTAGE_ORDER_GOODS_DETAILS)
  List<HiolabsOrderGoodsVO> getOrderGoodsDetails(@Param(value = "orderId") Integer orderId);
}
